package com.csun.cmny.provider.service.impl;

import com.csun.cmny.provider.dao.BuildingMapper;
import com.csun.cmny.provider.pojo.Building;
import com.csun.cmny.provider.service.BuildingService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service("BuildingService")
public class BuildingServiceImpl implements BuildingService {
    @Resource
    BuildingMapper buildingMapper;

    @Override
    public int insert(Building building) {
        return buildingMapper.insertSelective(building);
    }

    @Override
    public int deleteById(Integer buildingId) {
        return buildingMapper.deleteByPrimaryKey(buildingId);
    }

    @Override
    public int updateById(Building building) {
        return buildingMapper.updateByPrimaryKeySelective(building);
    }

    @Override
    public Building selectById(Integer buildingId) {
        return buildingMapper.selectByPrimaryKey(buildingId);
    }

    @Override
    public Building selectByBuilding(Building building) {
        return buildingMapper.selectByBuilding(building);
    }

    @Override
    public List<Building> showAll(Map<String, Object> queryMap) {
        return buildingMapper.showAll(queryMap);
    }

    @Override
    public List<Building> showAlls(Building building) {
        return buildingMapper.showAlls(building);
    }

    /**
     * 查询条数
     *
     * @param building
     * @return the count.
     */
    @Override
    public int selectCount(Building building) {
        return buildingMapper.selectCount(building);
    }
}
